    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>获取GPS经纬度</title>
    </head>
    <body>
    <script>
        if(navigator.geolocation){
            navigator.geolocation.getCurrentPosition(successCallback,errorCallback);
            // console.log("sorry!你的浏览器不支持地理定位！")
        }else{
            console.log("sorry!你的浏览器不支持地理定位！")
        }
            function successCallback(position) {
                 console.log("position"+position.coords.latitude+","+position.coords.longitude)
            }
        function errorCallback(error) {
            console.log(error)
        }
    </script>
    </body>
    </html>